# 
# Created with PyCharm.
# Description :
# User: jiume
# Date: 2024-12-10
# Time: 20:46
#
from tkinter.font import names


# class Person():
#     def __new__(cls, *args, **kwargs):
#         print('new方法执行了')
#         # 我们这里只是想去打印语句，其余的所有操作都是依靠父类的
#         # 这是在创建一个对象实例，得返回创建的结果
#         # 如果不return创建的对象，那么最终person就是None
#         return super().__new__(cls)
#
#     def __init__(self,name,age):
#         print('init方法执行了')
#         self.name = name
#         self.age = age
#
#     def show(self):
#         print(f'我的名字是{self.name},今年{self.age}岁')
#
#     def __str__(self):
#         # 这里返回的一定得是一个str对象
#         return f'姓名:{self.name},年龄:{self.age}'
#
# # 类名() --> 这就是在实例化一个对象，并且会自动调用init方法，构造对象
# person = Person('小明','18')
# print(person.__str__())
# print(person)
# # print(dir(person))


# class A():
#     pass
#
# class B:
#     pass
#
# class C(A,B):
#     def __init__(self,name,age):
#         self.name = name
#         self.age = age
#
# a = A()
# b = B()
# c =C('c',1)
#
# print('对象的属性字典:')
# print(a.__dict__)
# print(b.__dict__)
# print(c.__dict__)
#
# print('对象所属的类:')
# print(a.__class__)
# print(b.__class__)
# print(c.__class__)
#
# print('类的父元组:')
# print(A.__bases__)
# print(B.__bases__)
# print(C.__bases__)
#
# print('类的父类:')
# print(A.__base__)
# print(B.__base__)
# print(C.__base__)
#
# print('类的层次结构:')
# print(A.__mro__)
# print(B.__mro__)
# print(C.__mro__)
#
# print('类的子类列表')
# print(A.__subclasses__())
# print(B.__subclasses__())
# print(C.__subclasses__())